﻿<?xml version="1.0" standalone="yes"?>
<NewDataSet>
    <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <xs:element name="NewDataSet" msdata:IsDataSet="true">
            <xs:complexType>
                <xs:choice minOccurs="0" maxOccurs="unbounded">
                    <xs:element name="MetaDataCollections" msdata:MinimumCapacity="9">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="CollectionName" type="xs:string" minOccurs="0" />
                                <xs:element name="NumberOfRestrictions" type="xs:int" minOccurs="0" />
                                <xs:element name="NumberOfIdentifierParts" type="xs:int" minOccurs="0" />
                                <xs:element name="PopulationMechanism" type="xs:string" minOccurs="0" />
                                <xs:element name="PopulationString" type="xs:string" minOccurs="0" />
                                <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" />
                                <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" />
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="Restrictions" msdata:MinimumCapacity="3">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="CollectionName" type="xs:string" minOccurs="0" />
                                <xs:element name="RestrictionName" type="xs:string" minOccurs="0" />
                                <xs:element name="ParameterName" type="xs:string" minOccurs="0" />
                                <xs:element name="RestrictionDefault" type="xs:string" minOccurs="0" />
                                <xs:element name="RestrictionNumber" type="xs:int" minOccurs="0" />
                                <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" />
                                <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" />
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="DataSourceInformation" msdata:MinimumCapacity="18">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="CompositeIdentifierSeparatorPattern" type="xs:string" minOccurs="0" />
                                <xs:element name="DataSourceProductName" type="xs:string" minOccurs="0" />
                                <xs:element name="DataSourceProductVersion" type="xs:string" minOccurs="0" />
                                <xs:element name="DataSourceProductVersionNormalized" type="xs:string" minOccurs="0" />
                                <xs:element name="GroupByBehavior" msdata:DataType="System.Data.Common.GroupByBehavior, System.Data, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
                                <xs:element name="IdentifierPattern" type="xs:string" minOccurs="0" />
                                <xs:element name="IdentifierCase" msdata:DataType="System.Data.Common.IdentifierCase, System.Data, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
                                <xs:element name="OrderByColumnsInSelect" type="xs:boolean" minOccurs="0" />
                                <xs:element name="ParameterMarkerFormat" type="xs:string" minOccurs="0" />
                                <xs:element name="ParameterMarkerPattern" type="xs:string" minOccurs="0" />
                                <xs:element name="ParameterNameMaxLength" type="xs:int" minOccurs="0" />
                                <xs:element name="ParameterNamePattern" type="xs:string" minOccurs="0" />
                                <xs:element name="QuotedIdentifierPattern" type="xs:string" minOccurs="0" />
                                <xs:element name="QuotedIdentifierCase" msdata:DataType="System.Data.Common.IdentifierCase, System.Data, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
                                <xs:element name="StatementSeparatorPattern" type="xs:string" minOccurs="0" />
                                <xs:element name="StringLiteralPattern" type="xs:string" minOccurs="0" />
                                <xs:element name="SupportedJoinOperators" msdata:DataType="System.Data.Common.SupportedJoinOperators, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="DataTypes" msdata:MinimumCapacity="18">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="TypeName" type="xs:string" minOccurs="0" />
                                <xs:element name="ProviderDbType" type="xs:int" minOccurs="0" />
                                <xs:element name="ColumnSize" type="xs:long" minOccurs="0" />
                                <xs:element name="CreateFormat" type="xs:string" minOccurs="0" />
                                <xs:element name="CreateParameters" type="xs:string" minOccurs="0" />
                                <xs:element name="DataType" type="xs:string" minOccurs="0" />
                                <xs:element name="IsAutoIncrementable" type="xs:boolean" minOccurs="0" />
                                <xs:element name="IsBestMatch" type="xs:boolean" minOccurs="0" />
                                <xs:element name="IsCaseSensitive" type="xs:boolean" minOccurs="0" />
                                <xs:element name="IsFixedLength" type="xs:boolean" minOccurs="0" />
                                <xs:element name="IsFixedPrecisionScale" type="xs:boolean" minOccurs="0" />
                                <xs:element name="IsLong" type="xs:boolean" minOccurs="0" />
                                <xs:element name="IsNullable" type="xs:boolean" minOccurs="0" />
                                <xs:element name="IsSearchable" type="xs:boolean" minOccurs="0" />
                                <xs:element name="IsSearchableWithLike" type="xs:boolean" minOccurs="0" />
                                <xs:element name="IsUnsigned" type="xs:boolean" minOccurs="0" />
                                <xs:element name="MaximumScale" type="xs:short" minOccurs="0" />
                                <xs:element name="MinimumScale" type="xs:short" minOccurs="0" />
                                <xs:element name="IsConcurrencyType" type="xs:boolean" minOccurs="0" />
                                <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" />
                                <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" />
                                <xs:element name="IsLiteralSupported" type="xs:boolean" minOccurs="0" />
                                <xs:element name="LiteralPrefix" type="xs:string" minOccurs="0" />
                                <xs:element name="LiteralSuffix" type="xs:string" minOccurs="0" />
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="ReservedWords" msdata:MinimumCapacity="3">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="ReservedWord" type="xs:string" minOccurs="0" />
                                <xs:element name="MaximumVersion" type="xs:string" minOccurs="0" />
                                <xs:element name="MinimumVersion" type="xs:string" minOccurs="0" />
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                    <xs:element name="MyContactInformation" msdata:MinimumCapacity="3">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="Name" type="xs:string" minOccurs="0" />
                                <xs:element name="Title" type="xs:string" minOccurs="0" />
                                <xs:element name="Team" type="xs:string" minOccurs="0" />
                                <xs:element name="Location" type="xs:string" minOccurs="0" />
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>

                </xs:choice>
            </xs:complexType>
        </xs:element>
    </xs:schema>
    <MetaDataCollections>
        <CollectionName>MetaDataCollections</CollectionName>
        <NumberOfRestrictions>0</NumberOfRestrictions>
        <NumberOfIdentifierParts>0</NumberOfIdentifierParts>
        <PopulationMechanism>DataTable</PopulationMechanism>
        <PopulationString>MetaDataCollections</PopulationString>
    </MetaDataCollections>
    <MetaDataCollections>
        <CollectionName>Users</CollectionName>
        <NumberOfRestrictions>1</NumberOfRestrictions>
        <NumberOfIdentifierParts>1</NumberOfIdentifierParts>
        <PopulationMechanism>SQLCommand</PopulationMechanism>
        <PopulationString>select uid, name as user_name, createdate, updatedate from sysusers where (name = @Name or (@Name is null))</PopulationString>
    </MetaDataCollections>
    <MetaDataCollections>
        <CollectionName>Databases</CollectionName>
        <NumberOfRestrictions>1</NumberOfRestrictions>
        <NumberOfIdentifierParts>1</NumberOfIdentifierParts>
        <PopulationMechanism>SQLCommand</PopulationMechanism>
        <PopulationString>select name as database_name, dbid, crdate as create_date from master..sysdatabases where (name = @Name or (@Name is null))</PopulationString>
    </MetaDataCollections>
    <MetaDataCollections>
        <CollectionName>Tables</CollectionName>
        <NumberOfRestrictions>4</NumberOfRestrictions>
        <NumberOfIdentifierParts>3</NumberOfIdentifierParts>
        <PopulationMechanism>SQLCommand</PopulationMechanism>
        <PopulationString>select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE from INFORMATION_SCHEMA.TABLES where (TABLE_CATALOG = @Catalog or (@Catalog is null)) and (TABLE_SCHEMA = @Owner or (@Owner is null)) and (TABLE_NAME = @Name or (@Name is null)) and (TABLE_TYPE = @TableType or (@TableType is null))</PopulationString>
    </MetaDataCollections>
    <MetaDataCollections>
        <CollectionName>Columns</CollectionName>
        <NumberOfRestrictions>4</NumberOfRestrictions>
        <NumberOfIdentifierParts>4</NumberOfIdentifierParts>
        <PopulationMechanism>SQLCommand</PopulationMechanism>
        <PopulationString>select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, ORDINAL_POSITION, COLUMN_DEFAULT, CASE WHEN IS_NULLABLE = 'YES' THEN 1 ELSE 0 END IS_NULLABLE, DATA_TYPE, CASE DATA_TYPE WHEN 'ntext' THEN NULL WHEN 'image' THEN NULL WHEN 'text' THEN NULL ELSE CHARACTER_MAXIMUM_LENGTH END MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUMERIC_SCALE, DATETIME_PRECISION, CHARACTER_SET_CATALOG, CHARACTER_SET_SCHEMA, CHARACTER_SET_NAME, COLLATION_CATALOG from INFORMATION_SCHEMA.COLUMNS where (TABLE_CATALOG = @Catalog or (@Catalog is null)) and (TABLE_SCHEMA = @Owner or (@Owner is null)) and (TABLE_NAME = @Table or (@Table is null)) and (COLUMN_NAME = @Column or (@Column is null)) order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME</PopulationString>
    </MetaDataCollections>
    <MetaDataCollections>
        <CollectionName>PrimaryKeys</CollectionName>
        <NumberOfRestrictions>4</NumberOfRestrictions>
        <NumberOfIdentifierParts>3</NumberOfIdentifierParts>
        <PopulationMechanism>SQLCommand</PopulationMechanism>
        <PopulationString><![CDATA[select * from (select db_name() as CONSTRAINT_CATALOG,user_name(c_obj.uid) as CONSTRAINT_SCHEMA,i.name as CONSTRAINT_NAME,db_name() as TABLE_CATALOG,user_name(t_obj.uid) as TABLE_SCHEMA,t_obj.name as TABLE_NAME,col.name as COLUMN_NAME,v.number as ORDINAL_POSITION from sysobjects c_obj,sysobjects t_obj,syscolumns col,master.dbo.spt_values v,sysindexes i where permissions(t_obj.id) != 0 and c_obj.xtype in ('PK') and t_obj.id = c_obj.parent_obj and t_obj.xtype = 'U' and t_obj.id = col.id and col.name = index_col(t_obj.name,i.indid,v.number) and t_obj.id = i.id and c_obj.name = i.name and v.number > 0 and v.number <= i.keycnt and v.type = 'P') AS Temp1 where (CONSTRAINT_CATALOG = @Catalog or (@Catalog is null)) and (CONSTRAINT_SCHEMA = @Owner or (@Owner is null)) and (TABLE_NAME = @Table or (@Table is null)) and (CONSTRAINT_NAME = @Name or (@Name is null)) order by CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, TABLE_NAME, ORDINAL_POSITION]]></PopulationString>
    </MetaDataCollections>
    <MetaDataCollections>
        <CollectionName>Remarks</CollectionName>
        <NumberOfRestrictions>2</NumberOfRestrictions>
        <NumberOfIdentifierParts>2</NumberOfIdentifierParts>
        <PopulationMechanism>SQLCommand</PopulationMechanism>
        <PopulationString>SELECT COLUMN_NAME = objname, REMARKS = value FROM ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', @Table, 'column', @Name);</PopulationString>
    </MetaDataCollections>
    <Restrictions>
        <CollectionName>Users</CollectionName>
        <RestrictionName>User_Name</RestrictionName>
        <ParameterName>@Name</ParameterName>
        <RestrictionDefault>name</RestrictionDefault>
        <RestrictionNumber>1</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Databases</CollectionName>
        <RestrictionName>Name</RestrictionName>
        <ParameterName>@Name</ParameterName>
        <RestrictionDefault>Name</RestrictionDefault>
        <RestrictionNumber>1</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Tables</CollectionName>
        <RestrictionName>Catalog</RestrictionName>
        <ParameterName>@Catalog</ParameterName>
        <RestrictionDefault>TABLE_CATALOG</RestrictionDefault>
        <RestrictionNumber>1</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Tables</CollectionName>
        <RestrictionName>Owner</RestrictionName>
        <ParameterName>@Owner</ParameterName>
        <RestrictionDefault>TABLE_SCHEMA</RestrictionDefault>
        <RestrictionNumber>2</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Tables</CollectionName>
        <RestrictionName>Table</RestrictionName>
        <ParameterName>@Name</ParameterName>
        <RestrictionDefault>TABLE_NAME</RestrictionDefault>
        <RestrictionNumber>3</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Tables</CollectionName>
        <RestrictionName>TableType</RestrictionName>
        <ParameterName>@TableType</ParameterName>
        <RestrictionDefault>TABLE_TYPE</RestrictionDefault>
        <RestrictionNumber>4</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Columns</CollectionName>
        <RestrictionName>Catalog</RestrictionName>
        <ParameterName>@Catalog</ParameterName>
        <RestrictionDefault>TABLE_CATALOG</RestrictionDefault>
        <RestrictionNumber>1</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Columns</CollectionName>
        <RestrictionName>Owner</RestrictionName>
        <ParameterName>@Owner</ParameterName>
        <RestrictionDefault>TABLE_SCHEMA</RestrictionDefault>
        <RestrictionNumber>2</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Columns</CollectionName>
        <RestrictionName>Table</RestrictionName>
        <ParameterName>@Table</ParameterName>
        <RestrictionDefault>TABLE_NAME</RestrictionDefault>
        <RestrictionNumber>3</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Columns</CollectionName>
        <RestrictionName>Column</RestrictionName>
        <ParameterName>@Column</ParameterName>
        <RestrictionDefault>COLUMN_NAME</RestrictionDefault>
        <RestrictionNumber>4</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>PrimaryKeys</CollectionName>
        <RestrictionName>Catalog</RestrictionName>
        <ParameterName>@Catalog</ParameterName>
        <RestrictionDefault>CONSTRAINT_CATALOG</RestrictionDefault>
        <RestrictionNumber>1</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>PrimaryKeys</CollectionName>
        <RestrictionName>Owner</RestrictionName>
        <ParameterName>@Owner</ParameterName>
        <RestrictionDefault>CONSTRAINT_SCHEMA</RestrictionDefault>
        <RestrictionNumber>2</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>PrimaryKeys</CollectionName>
        <RestrictionName>Table</RestrictionName>
        <ParameterName>@Table</ParameterName>
        <RestrictionDefault>TABLE_NAME</RestrictionDefault>
        <RestrictionNumber>3</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>PrimaryKeys</CollectionName>
        <RestrictionName>Name</RestrictionName>
        <ParameterName>@Name</ParameterName>
        <RestrictionDefault>CONSTRAINT_NAME</RestrictionDefault>
        <RestrictionNumber>4</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Remarks</CollectionName>
        <RestrictionName>Table</RestrictionName>
        <ParameterName>@Table</ParameterName>
        <RestrictionDefault>TABLE_NAME</RestrictionDefault>
        <RestrictionNumber>1</RestrictionNumber>
    </Restrictions>
    <Restrictions>
        <CollectionName>Remarks</CollectionName>
        <RestrictionName>Name</RestrictionName>
        <ParameterName>@Name</ParameterName>
        <RestrictionDefault>COLUMN_NAME</RestrictionDefault>
        <RestrictionNumber>2</RestrictionNumber>
    </Restrictions>
</NewDataSet>